
/*
 * Hlpay-Plus aggregate payment system.
 * Copyright (c) 2024-2025 Hlpay Team Copyright has the right of final interpretation.
 */

package com.hlkj.pay.common;

import com.hlkj.framework.common.exception.IErrorCode;
import com.hlkj.pay.common.constants.ResultCodeConstant;

/**
 * @author lyc
 */

public enum MerchantResultCode implements IErrorCode {
    MERCHANT_CHANNEL_CALLBACK_SIGN_ERROR( ResultCodeConstant.MERCHANT_PREFIX, "通道回调签名错误"),
    MERCHANT_REGISTER_ERROR( ResultCodeConstant.MERCHANT_PREFIX+1, "商户注册失败,生成商户sn失败,请稍后再试"),
    MERCHANT_REGISTER_NOT_EXIST( ResultCodeConstant.MERCHANT_PREFIX+2, "商户注册失败,商户平台不可注册"),
    MERCHANT_DOES_EXIST( ResultCodeConstant.MERCHANT_PREFIX+3, "商户已存在"),
    MERCHANT_NOT_EXIST( ResultCodeConstant.MERCHANT_PREFIX+4, "商户不存在"),
    MERCHANT_NOT_EFFECT( ResultCodeConstant.MERCHANT_PREFIX+5, "商户无效"),
    MERCHANT_COMM_RATE_BASE_EXIST( ResultCodeConstant.MERCHANT_PREFIX+6, "商户外扣手续费率不存在"),

    MERCHANT_CONFIG_NOT_EXIST( ResultCodeConstant.MERCHANT_PREFIX+7, "商户配置不存在"),
    MERCHANT_CONFIG_PROVIDER_NOT_EXIST( ResultCodeConstant.MERCHANT_PREFIX+8, "商户服务商配置不存在"),
    MERCHANT_CONFIG_CHANNEL_NOT_EXIST( ResultCodeConstant.MERCHANT_PREFIX+10, "商户未配置默认通道"),
    MERCHANT_TRAN_PWD_NOT_EXIST( ResultCodeConstant.MERCHANT_PREFIX+9, "商户交易密码为空,请先修改"),
    MERCHANT_TRAN_PWD_ERROR( ResultCodeConstant.MERCHANT_PREFIX+9, "商户交易密码错误"),
    MERCHANT_APP_EXIST( ResultCodeConstant.MERCHANT_PREFIX+101, "商户app已存在"),
    MERCHANT_APP_NOT_EXIST( ResultCodeConstant.MERCHANT_PREFIX+102, "商户app不存在"),
    MERCHANT_APP_NOT_EFFECT( ResultCodeConstant.MERCHANT_PREFIX+103, "商户app未启用"),

    MERCHANT_APP_SAVE_ERROR( ResultCodeConstant.MERCHANT_PREFIX+104, "生成商户app_id失败,请稍后再试"),
    MERCHANT_APP_CHANNEL_NOT_EXIST( ResultCodeConstant.MERCHANT_PREFIX+201, "商户app通道不存在"),
    MERCHANT_APP_CHANNEL_EXIST( ResultCodeConstant.MERCHANT_PREFIX+202, "商户app通道已存在"),

    MERCHANT_ACCESS_NOT_EXIST( ResultCodeConstant.MERCHANT_PREFIX+301, "商户进件不存在"),
    MERCHANT_ACCESS_CONFIG_NOT_EXIST( ResultCodeConstant.MERCHANT_PREFIX+302, "商户进件不存在"),
    MERCHANT_ACCESS_FILE_ERROR( ResultCodeConstant.MERCHANT_PREFIX+303, "商户进件图片上传失败"),
    MERCHANT_ACCESS_PARAMS_ERROR( ResultCodeConstant.MERCHANT_PREFIX+304, "商户进件参数校验失败,"),

    MERCHANT_PAY_ORDER_HAS_SUCCESS( ResultCodeConstant.MERCHANT_PREFIX+402, "订单已支付成功"),
    MERCHANT_PAY_ORDER_HAS_CANCEL( ResultCodeConstant.MERCHANT_PREFIX+403, "订单已取消支付"),
    MERCHANT_PAY_ORDER_HAS_CLOSE( ResultCodeConstant.MERCHANT_PREFIX+404, "订单已关闭"),

    MERCHANT_PAY_ORDER_FAIL( ResultCodeConstant.MERCHANT_PREFIX+406, "订单下单失败"),
    MERCHANT_PAY_ORDER_NOT_EXIST( ResultCodeConstant.MERCHANT_PREFIX+407, "订单不存在"),
    MERCHANT_PAY_ORDER_CANNOT_CLOSE( ResultCodeConstant.MERCHANT_PREFIX+408, "订单非支付中不可取消"),
    MERCHANT_PAY_ORDER_CANNOT_PAY( ResultCodeConstant.MERCHANT_PREFIX+409, "订单非支付中不可重新支付"),
    MERCHANT_FEE_AMOUNT_NOT_ENOUGH( ResultCodeConstant.MERCHANT_PREFIX+410, "商户手续费账户不足"),
    MERCHANT_PAY_ORDER_OPERATE_FAIL( ResultCodeConstant.MERCHANT_PREFIX+411, "订单操作失败"),
    MERCHANT_COMM_RATE_ERROR( ResultCodeConstant.MERCHANT_PREFIX+412, "商户外扣手续费必须大于代理商"),
    MERCHANT_COMM_BLOCKBAL_ERROR( ResultCodeConstant.MERCHANT_PREFIX+412, "上级代理商余额拦截则商户必须设置拦截"),



    MERCHANT_REFUND_AMOUNT_ERROR( ResultCodeConstant.MERCHANT_PREFIX+501, "订单可退款金额不够"),
    MERCHANT_REFUNDING_ERROR( ResultCodeConstant.MERCHANT_PREFIX+502, "当前退款订单未执行完成,请退款完成后发起"),

    MERCHANT_REFUND_ORDER_FAIL( ResultCodeConstant.MERCHANT_PREFIX+503, "订单退款失败"),

    MERCHANT_REFUND_ORDER_NO_ERROR( ResultCodeConstant.MERCHANT_PREFIX+504, "退款订单号生成失败,请重新发起请求"),

    MERCHANT_REFUND_ORDER_NOT_EXIST( ResultCodeConstant.MERCHANT_PREFIX+505, "退款不存在"),


    MERCHANT_RECEIVE_ORDER_LIMIT( ResultCodeConstant.MERCHANT_PREFIX+506, "收款单支付次数超限"),
    MERCHANT_RECEIVE_ORDER_CLOSED( ResultCodeConstant.MERCHANT_PREFIX+507, "收款单已关闭"),
    MERCHANT_RECEIVE_ORDER_COLLETINFO_ERROR( ResultCodeConstant.MERCHANT_PREFIX+508, "收款单收集信息必填参数缺失"),

    MERCHANT_PAYMENT_NOT_EXIST( ResultCodeConstant.MERCHANT_PREFIX+601, "代付不存在"),
    MERCHANT_PAYMENT_APPROVED( ResultCodeConstant.MERCHANT_PREFIX+602, "当前代付不可审核"),
    MERCHANT_PAYMENT_CANNOT_SYNC( ResultCodeConstant.MERCHANT_PREFIX+603, "当前代付不可同步状态"),
    MERCHANT_CHANNEL_BALANCE_NOT_ENOUGH( ResultCodeConstant.MERCHANT_PREFIX+604, "当前通道余额不足"),
    MERCHANT_PAYMENT_NOT_SUCCESS( ResultCodeConstant.MERCHANT_PREFIX+603, "当前代付非执行成功"),
    MERCHANT_PROFIT_ACCOUNT_FUND_PROCESS_TYPE_NULL( ResultCodeConstant.MERCHANT_PREFIX+700, "分账类型为空"),
    MERCHANT_PROFIT_ACCOUNT_FEE_ERROR( ResultCodeConstant.MERCHANT_PREFIX+701, "分账费率超过100%"),
    MERCHANT_PROFIT_ACCOUNT_RATE_ERROR( ResultCodeConstant.MERCHANT_PREFIX+702, "分账比例超过100%"),


    MERCHANT_COMPLAINT_CONFIG_NOT_EXIST( ResultCodeConstant.MERCHANT_PREFIX+710, "商户投诉通道配置不存在"),


    REPORT_CONFIG_PAY_AMOUNT_ERROR( ResultCodeConstant.MERCHANT_PREFIX+801, "报备参数配置支付总金额比例大于1"),
    MERCHANT_CHANNEL_CALLBACK_SPLIT_ERROR( ResultCodeConstant.MERCHANT_PREFIX+901, "通道拆分失败"),

    CASHIER_PAYMENT_URL_EXCEPTION( ResultCodeConstant.MERCHANT_PREFIX+909, "商户应用生成快捷收银链接异常"),

    ;

    /**
     * 错误码
     */
    private final Integer code;
    /**
     * 错误提示
     */
    private final String msg;

    MerchantResultCode(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public String getMsg() {
        return msg;
    }

}
